﻿namespace Helpers.Common
{
    public class MissingArgumentResponse<DataType> : ResponseMessageTemplate<DataType>
    {
        #region Properties

        private string argumentName;
        public string ArgumentName
        {
            get { return this.argumentName; }
            protected set
            {
                this.argumentName = value;

                this.UpdateMessage();
            }
        }

        #endregion

        #region Static Properties

        private const string DEFAULT_MSG_TEMPLATE = "The argument '{0}' can not be empty or null.";

        #endregion

        public MissingArgumentResponse(string argumentName)
            : this(argumentName, DEFAULT_MSG_TEMPLATE) { }
        public MissingArgumentResponse(string argumentName, string messageTemplate)
            : base(messageTemplate)
        {
            this.ArgumentName = argumentName;
        }

        #region Methods

        protected override void UpdateMessage()
        {
            this.UpdateMessage(this.ArgumentName);
        }

        #endregion
    }

    public class MissingArgumentResponse : ResponseMessageTemplate
    {
        #region Properties

        private string argumentName;
        public string ArgumentName
        {
            get { return this.argumentName; }
            protected set
            {
                this.argumentName = value;

                this.UpdateMessage();
            }
        }

        #endregion

        #region Static Properties

        private const string DEFAULT_MSG_TEMPLATE = "The argument '{0}' can not be empty or null.";

        #endregion

        public MissingArgumentResponse(string message)
            : base(message) { }
        public MissingArgumentResponse(string argumentName, string messageTemplate)
            : base(messageTemplate) { }

        #region Methods

        protected override void UpdateMessage()
        {
            this.UpdateMessage(this.ArgumentName);
        }

        #endregion
    }
}